package tech.aistar.mapper;

import org.apache.ibatis.annotations.*;
import tech.aistar.pojo.User;

import java.util.List;

@Mapper
public interface UserMapper {

    @Select("select * from user where username = #{username}")
    User findByUsername(String username);


    @Delete("delete from `user` where username=#{username}")
    int delByIName(String username);

    @Insert("insert into `user`(username,pwd_hash,real_name,id_card) values(#{username},#{pwdHash},#{realName},#{idCard});")
    int save(User user);

    @Update("update `user` set username=#{username},pwd_hash=#{pwdHash},real_name=#{realName},id_card=#{idCard} where id=#{id}")
    int update(User user);



}